home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue62 / Clinic / LinkResU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-09-02  |  713 b   |  42 lines

  1. unit LinkResU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Image1: TImage;
  12.     procedure FormCreate(Sender: TObject);
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. {$R Image.res} //Link in resource file
  27.  
  28. procedure TForm1.FormCreate(Sender: TObject);
  29. var
  30.   RS: TResourceStream;
  31. begin
  32.   RS := TResourceStream.Create(HInstance, 'AthenaImage', 'BitmapData');
  33.   try
  34.     //Load image data into TImage component
  35.     Image1.Picture.Bitmap.LoadFromStream(RS)
  36.   finally
  37.     RS.Free
  38.   end
  39. end;
  40.  
  41. end.
  42.